﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Terraria.DataStructures
{
	// Token: 0x0200047E RID: 1150
	public struct DrawData
	{
		// Token: 0x060026AB RID: 9899 RVA: 0x00492794 File Offset: 0x00490994
		public DrawData(Texture2D texture, Vector2 position, Color color)
		{
			this.texture = texture;
			this.position = position;
			this.color = color;
			this.destinationRectangle = default(Rectangle);
			this.sourceRect = DrawData.nullRectangle;
			this.rotation = 0f;
			this.origin = Vector2.Zero;
			this.scale = Vector2.One;
			this.effect = SpriteEffects.None;
			this.shader = 0;
			this.ignorePlayerRotation = false;
			this.useDestinationRectangle = false;
		}

		// Token: 0x060026AC RID: 9900 RVA: 0x0049280C File Offset: 0x00490A0C
		public DrawData(Texture2D texture, Vector2 position, Rectangle? sourceRect, Color color)
		{
			this.texture = texture;
			this.position = position;
			this.color = color;
			this.destinationRectangle = default(Rectangle);
			this.sourceRect = sourceRect;
			this.rotation = 0f;
			this.origin = Vector2.Zero;
			this.scale = Vector2.One;
			this.effect = SpriteEffects.None;
			this.shader = 0;
			this.ignorePlayerRotation = false;
			this.useDestinationRectangle = false;
		}

		// Token: 0x060026AD RID: 9901 RVA: 0x00492880 File Offset: 0x00490A80
		public DrawData(Texture2D texture, Vector2 position, Rectangle? sourceRect, Color color, float rotation, Vector2 origin, float scale, SpriteEffects effect, int inactiveLayerDepth)
		{
			this.texture = texture;
			this.position = position;
			this.sourceRect = sourceRect;
			this.color = color;
			this.rotation = rotation;
			this.origin = origin;
			this.scale = new Vector2(scale, scale);
			this.effect = effect;
			this.destinationRectangle = default(Rectangle);
			this.shader = 0;
			this.ignorePlayerRotation = false;
			this.useDestinationRectangle = false;
		}

		// Token: 0x060026AE RID: 9902 RVA: 0x004928F4 File Offset: 0x00490AF4
		public DrawData(Texture2D texture, Vector2 position, Rectangle? sourceRect, Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effect, int inactiveLayerDepth)
		{
			this.texture = texture;
			this.position = position;
			this.sourceRect = sourceRect;
			this.color = color;
			this.rotation = rotation;
			this.origin = origin;
			this.scale = scale;
			this.effect = effect;
			this.destinationRectangle = default(Rectangle);
			this.shader = 0;
			this.ignorePlayerRotation = false;
			this.useDestinationRectangle = false;
		}

		// Token: 0x060026AF RID: 9903 RVA: 0x00492960 File Offset: 0x00490B60
		public DrawData(Texture2D texture, Rectangle destinationRectangle, Color color)
		{
			this.texture = texture;
			this.destinationRectangle = destinationRectangle;
			this.color = color;
			this.position = Vector2.Zero;
			this.sourceRect = DrawData.nullRectangle;
			this.rotation = 0f;
			this.origin = Vector2.Zero;
			this.scale = Vector2.One;
			this.effect = SpriteEffects.None;
			this.shader = 0;
			this.ignorePlayerRotation = false;
			this.useDestinationRectangle = true;
		}

		// Token: 0x060026B0 RID: 9904 RVA: 0x004929D8 File Offset: 0x00490BD8
		public DrawData(Texture2D texture, Rectangle destinationRectangle, Rectangle? sourceRect, Color color)
		{
			this.texture = texture;
			this.destinationRectangle = destinationRectangle;
			this.color = color;
			this.position = Vector2.Zero;
			this.sourceRect = sourceRect;
			this.rotation = 0f;
			this.origin = Vector2.Zero;
			this.scale = Vector2.One;
			this.effect = SpriteEffects.None;
			this.shader = 0;
			this.ignorePlayerRotation = false;
			this.useDestinationRectangle = true;
		}

		// Token: 0x060026B1 RID: 9905 RVA: 0x00492A4C File Offset: 0x00490C4C
		public DrawData(Texture2D texture, Rectangle destinationRectangle, Rectangle? sourceRect, Color color, float rotation, Vector2 origin, SpriteEffects effect, int inactiveLayerDepth)
		{
			this.texture = texture;
			this.destinationRectangle = destinationRectangle;
			this.sourceRect = sourceRect;
			this.color = color;
			this.rotation = rotation;
			this.origin = origin;
			this.effect = effect;
			this.position = Vector2.Zero;
			this.scale = Vector2.One;
			this.shader = 0;
			this.ignorePlayerRotation = false;
			this.useDestinationRectangle = true;
		}

		// Token: 0x060026B2 RID: 9906 RVA: 0x00492ABC File Offset: 0x00490CBC
		public void Draw(SpriteBatch sb)
		{
			if (this.useDestinationRectangle)
			{
				sb.Draw(this.texture, this.destinationRectangle, this.sourceRect, this.color, this.rotation, this.origin, this.effect, 0f);
				return;
			}
			sb.Draw(this.texture, this.position, this.sourceRect, this.color, this.rotation, this.origin, this.scale, this.effect, 0f);
		}

		// Token: 0x04004360 RID: 17248
		public Texture2D texture;

		// Token: 0x04004361 RID: 17249
		public Vector2 position;

		// Token: 0x04004362 RID: 17250
		public Rectangle destinationRectangle;

		// Token: 0x04004363 RID: 17251
		public Rectangle? sourceRect;

		// Token: 0x04004364 RID: 17252
		public Color color;

		// Token: 0x04004365 RID: 17253
		public float rotation;

		// Token: 0x04004366 RID: 17254
		public Vector2 origin;

		// Token: 0x04004367 RID: 17255
		public Vector2 scale;

		// Token: 0x04004368 RID: 17256
		public SpriteEffects effect;

		// Token: 0x04004369 RID: 17257
		public int shader;

		// Token: 0x0400436A RID: 17258
		public bool ignorePlayerRotation;

		// Token: 0x0400436B RID: 17259
		public readonly bool useDestinationRectangle;

		// Token: 0x0400436C RID: 17260
		public static Rectangle? nullRectangle;
	}
}
